package com.macro.mall.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author super
 * @title: MyWebAppConfigurer
 * @description: TODO
 * @date 2020/8/18 14:53
 */
@Configuration
public class MyWebAppConfigurer implements WebMvcConfigurer {

    @Value("${images.path}")
    String path;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/images/**").addResourceLocations("file:"+ path);
    }
}
